#pragma once
#include "LumineBuffer.hpp"
namespace Lumine
{
    class UniformBuffer : public LumineBuffer
    {
    private:
        std::vector<vk::raii::Buffer> uniformBuffers;
        std::vector<vk::raii::DeviceMemory> uniformBuffersMemory;
        std::vector<void *> uniformBuffersMapped;

        

    public:
        UniformBuffer() = default;
        // 继承基类的不可复制性：显式删除拷贝操作
        UniformBuffer(const UniformBuffer &) = delete;
        UniformBuffer &operator=(const UniformBuffer &) = delete;

        // 允许移动操作
        UniformBuffer(UniformBuffer &&) = default;
        UniformBuffer &operator=(UniformBuffer &&) = default;
        ~UniformBuffer() = default;
        
        void Create(vk::DeviceSize size) override;
        void Bind(const vk::raii::CommandBuffer &cmd) override;
        void cleanUp() override;
        
        const std::vector<vk::raii::Buffer> &UniformBuffers() const { return uniformBuffers; }
        const vk::raii::Buffer &GetUniformBuffer(uint32_t index) const { return uniformBuffers[index]; }
        const std::vector<void *> &UniformBuffersMapped() const { return uniformBuffersMapped; }
    };
};